﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcAppDemo.Controllers
{
    public class myErrorHandle : HandleErrorAttribute
    {
    }

    [HandleError]
    public class TestController : Controller
    {
        //
        // GET: /Test/

        public ActionResult Index(int? id)
        {
            return View();
        }

        public string Test1()
        {
            return DateTime.Now.ToString();
        }

        public ContentResult Test2()
        {
            return Content("No html body page");
        }

        [AcceptVerbs(HttpVerbs.Get)]
        public JsonResult Test3()
        {
            var a = Request.QueryString["a"];
            var b = Request.QueryString["b"];
            IList<string> list = new List<string>();
            list.Add("a");
            list.Add("b");
            list.Add("c");
            list.Add(a);
            list.Add(b);
            return Json(list, JsonRequestBehavior.AllowGet);
        }
    }

    public static class TestC
    {
        public static string GetMore(this TestController er)
        {
            return "SSS";
        }
    }
}
